home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 13165 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Can you printf a long
  5. Date: 4 Apr 1996 17:40:33 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4k1mlh$3lh@solutions.solon.com>
  8. References: <4ju8o1$dc3@news.netam.net> <4APR199610244914@erich.triumf.ca>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <4APR199610244914@erich.triumf.ca>,
  12. P.Bennett <bennett@erich.triumf.ca> wrote:
  13. >An int must be _at_ _least_ 2 bytes, but may be longer.  A long must be  at
  14. >least as long as an int, but may (or may not) be longer.  It seems that on
  15. >your system, both int and long are 32 bits (4 bytes).
  16.  
  17. This is not quite correct; an int must be at least 16 bits.  This may be
  18. only one byte; a byte in C is simply equivalent to a char, which must be at
  19. least 8 bits, but may be larger.  It is legit for sizeof(long) to be 1,
  20. and all types to be 32 bits, or 64 bits, or whatever.
  21.  
  22. In particular, int may be 1 byte, as long as that byte is at least 16 bits.
  23.  
  24. >Floats are stored in a quite different format than ints and longs.
  25.  
  26. This is almost always true.  :)
  27.  
  28. -s
  29. -- 
  30. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  31. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  32. FUCK the communications decency act.  Goddamned government.  [literally.]
  33. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  34.